<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="themes/base.min.css" />
    <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="themes/jquery.mobile.structure-1.4.5.min.css" />
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/jquery.mobile-1.4.5.min.js"></script>
    <script src="/resources/util.js"></script>
    <title>幸运抽奖管理</title>
    <style type="text/css">
        .content{
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            padding: 20px;
            box-sizing: border-box;
        }
        .qrcode{
            width: 100%;
            margin: 20px;
        }
    </style>
</head>

<body>
    <div class="content">
    <img class="qrcode"/>
    <p>长按图片保存或者转发</p>
    </div>
    <script type="text/javascript">
        function GetQueryString(name) {
			 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			 var r = window.location.search.substr(1).match(reg);
			 if(r!=null)return  unescape(r[2]); return null;
		}
        let app_id = GetQueryString("app_id");
        $(function(){
            
            $(".qrcode").prop("src","/plugin/api/wx.app.qrcode.shop.launch?app_id="+app_id+"&scene=forward:https://"+window.location.host+"/zhuanpan.pl/index.html?app_id="+app_id+"&width=750");
            $(".qrcode").click(function(){
                $.ajax({
                    url:"/plugin/api/wx.app.call?name=previewImage&asyn=true",
                    type:"POST",
                    contentType:"application/json",
                    data:JSON.stringify({current:this.src,urls:[this.src]})
                });
            });
        });
    </script>
</body>

</html>
